<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>贵阳轨道交通</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <META http-equiv=Content-Type content="text/html; charset=utf-8">
    <META content="MSHTML 6.00.3790.4807" name=GENERATOR>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no, viewport-fit=cover">
<meta http-equiv="x-dns-prefetch-control" content="on">
    
    <script type="text/javascript" src="./guiyang_subway_data.js"></script>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=ad17babae123cfc6568dd60e371ed512&plugin=AMap.Adaptor,AMap.Transfer,AMap.moveAnimation,AMap.Marker"></script>
    <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    
    <style>
      html,
      body,
      #container {
          width: 100%;
          height: 100%;
          padding: 0;
          margin: 0;
      } 
    </style>

</head>
<body>
 
<div id="container"  >
</div>  
<div id="panel"></div>

<script>
 var map = new AMap.Map("container", {
      resizeEnable: true,
      center: [106.675334,26.619512],
      zoom: 12,
  });

/*var map = new AMap.Map('container', {
         center: [106.675334,26.619512],
        viewMode: '3D',
        pitch: 60,
        rotation: -35,
        // 隐藏默认楼块
        features: ['bg', 'road', 'point'],
        mapStyle: 'amap://styles/light',
        
        zoom: 12
    });*/

// 创建一个 Icon
var startIcon = new AMap.Icon({
    // 图标尺寸
    size: new AMap.Size(25, 34),
    // 图标的取图地址
    image: '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',
    // 图标所用图片大小
    imageSize: new AMap.Size(135, 40),
    // 图标取图偏移量
    imageOffset: new AMap.Pixel(-9, -3)
});
// 创建一个 icon
var endIcon = new AMap.Icon({
    size: new AMap.Size(25, 34),
    image: '//a.amap.com/jsapi_demos/static/demo-center/icons/dir-marker.png',
    imageSize: new AMap.Size(135, 40),
    imageOffset: new AMap.Pixel(-95, -3)
});
// 站点文字样式
var textStyle = {
    fontSize: 12,
    fontWeight: 'normal',
    fillColor: '#fff',
    padding: '2, 5',
    backgroundColor: 'rgb(246,137,38)',
    borderColor: '#fff',
    borderWidth: 1,
};

// ======================= 绘制1号线开始 ===================================

var line_1_stop_maker = [];
var line_1_stop_cycle = [];
 for(var i in line_1_stop) {
    var item = line_1_stop[i];
    var stop_marker = new AMap.LabelMarker({
        name: item.name,
        position: [item.location[0], item.location[1]],
        text: {
            content: item.name,
            direction: 'left'
        }
    });
    var stop_marker_cycle =  new AMap.CircleMarker({
          center: [item.location[0], item.location[1]],
          radius:2.5,
          strokeColor:'rgb(134, 184, 28)',
          strokeWeight:1.5, 
          fillColor:'rgba(255,255,255,1)',
          fillOpacity:0.5,
        })
    line_1_stop_maker.push(stop_marker);
    line_1_stop_cycle.push(stop_marker_cycle);
 }
 map.add(line_1_stop_maker);
 map.add(line_1_stop_cycle);

    // 绘制轨迹
    var line_1_polyline = new AMap.Polyline({
        map: map,
        path: line_1_path,
        showDir:true,
        //strokeColor: 'rgb(134, 184, 28)',  //线颜色
        strokeColor: "rgb(134, 184, 28)",  //线颜色
        // strokeOpacity: 1,     //线透明度
        strokeWeight: 5,      //线宽
  
        // strokeStyle: "solid"  //线样式
    });

  // 将 icon 传入 marker
  var  line_1_startMarker = new AMap.Marker({
      position: new AMap.LngLat(line_1_start[0],line_1_start[1]),
      icon: startIcon,
      offset: new AMap.Pixel(-13, -30)
  });

  

  // 将 icon 传入 marker
  var  line_1_endMarker = new AMap.Marker({
      position: new AMap.LngLat(line_1_end[0],line_1_end[1]),
      icon: endIcon,
      offset: new AMap.Pixel(-13, -30)
  });

// 将 markers 添加到地图
 map.add([    line_1_startMarker,  line_1_endMarker]);


// ======================= 绘制2号线开始 ===================================

var line_2_stop_maker = [];
var line_2_stop_cycle = [];
 for(var i in line_2_stop) {
    var item = line_2_stop[i];
    var stop_marker = new AMap.LabelMarker({
        name: item.name,
        position: [item.location[0], item.location[1]],
        text: {
            content: item.name,
            direction: 'center'
        }
    });
    var stop_marker_cycle =  new AMap.CircleMarker({
          center: [item.location[0], item.location[1]],
          radius:2.5,
          strokeColor:'rgb(134, 184, 28)',
          strokeWeight:1.5, 
          fillColor:'rgba(255,255,255,1)',
          fillOpacity:0.5,
        })
    line_2_stop_maker.push(stop_marker);
    line_2_stop_cycle.push(stop_marker_cycle);
 }
 map.add(line_2_stop_maker);
 map.add(line_2_stop_cycle);

    // 绘制轨迹
    var line_2_polyline = new AMap.Polyline({
        map: map,
        path: line_2_path,
        showDir:true,
        //strokeColor: 'rgb(134, 184, 28)',  //线颜色
        strokeColor: "rgb(34, 73, 163)",  //线颜色
        // strokeOpacity: 1,     //线透明度
        strokeWeight: 5,      //线宽
  
        // strokeStyle: "solid"  //线样式
    });

  // 将 icon 传入 marker
  var  line_2_startMarker = new AMap.Marker({
      position: new AMap.LngLat(line_2_start[0],line_2_start[1]),
      icon: startIcon,
      offset: new AMap.Pixel(-13, -30)
  });

  

  // 将 icon 传入 marker
  var  line_2_endMarker = new AMap.Marker({
      position: new AMap.LngLat(line_2_end[0],line_2_end[1]),
      icon: endIcon,
      offset: new AMap.Pixel(-13, -30)
  });

// 将 markers 添加到地图
 map.add([    line_2_startMarker,  line_2_endMarker]);

 // ======================= 绘制3号线开始 ===================================

var line_3_stop_maker = [];
var line_3_stop_cycle = [];
 for(var i in line_3_stop) {
    var item = line_3_stop[i];
    var stop_marker = new AMap.LabelMarker({
        name: item.name,
        position: [item.location[0], item.location[1]],
        text: {
            content: item.name,
            direction: 'center'
        }
    });
    var stop_marker_cycle =  new AMap.CircleMarker({
          center: [item.location[0], item.location[1]],
          radius:2.5,
          strokeColor:'rgb(134, 184, 28)',
          strokeWeight:1.5, 
          fillColor:'rgba(255,255,255,1)',
          fillOpacity:0.5,
        })
    line_3_stop_maker.push(stop_marker);
    line_3_stop_cycle.push(stop_marker_cycle);
 }
 map.add(line_3_stop_maker);
 map.add(line_3_stop_cycle);

    // 绘制轨迹
    var line_3_polyline = new AMap.Polyline({
        map: map,
        path: line_3_path,
        showDir:true,
        //strokeColor: 'rgb(134, 184, 28)',  //线颜色
        strokeColor: "rgb(34, 73, 163)",  //线颜色
        // strokeOpacity: 1,     //线透明度
        strokeWeight: 5,      //线宽
  
        // strokeStyle: "solid"  //线样式
    });

  // 将 icon 传入 marker
  var  line_3_startMarker = new AMap.Marker({
      position: new AMap.LngLat(line_3_start[0],line_3_start[1]),
      icon: startIcon,
      offset: new AMap.Pixel(-13, -30)
  });

  

  // 将 icon 传入 marker
  var  line_3_endMarker = new AMap.Marker({
      position: new AMap.LngLat(line_3_end[0],line_3_end[1]),
      icon: endIcon,
      offset: new AMap.Pixel(-13, -30)
  });

// 将 markers 添加到地图
 map.add([    line_3_startMarker,  line_3_endMarker]);
 

 // ======================= 绘制S1号线开始 ===================================

var line_s1_stop_maker = [];
var line_s1_stop_cycle = [];
 for(var i in line_s1_stop) {
    var item = line_s1_stop[i];
    var stop_marker = new AMap.LabelMarker({
        name: item.name,
        position: [item.location[0], item.location[1]],
        text: {
            content: item.name,
            direction: 'center'
        }
    });
    var stop_marker_cycle =  new AMap.CircleMarker({
          center: [item.location[0], item.location[1]],
          radius:2.5,
          strokeColor:'rgb(134, 184, 28)',
          strokeWeight:1.5, 
          fillColor:'rgba(255,255,255,1)',
          fillOpacity:0.5,
        })
    line_s1_stop_maker.push(stop_marker);
    line_s1_stop_cycle.push(stop_marker_cycle);
 }
 map.add(line_s1_stop_maker);
 map.add(line_s1_stop_cycle);

    // 绘制轨迹
    var line_s1_polyline = new AMap.Polyline({
        map: map,
        path: line_s1_path,
        showDir:true,
        //strokeColor: 'rgb(134, 184, 28)',  //线颜色
        strokeColor: "rgb(34, 73, 163)",  //线颜色
        // strokeOpacity: 1,     //线透明度
        strokeWeight: 5,      //线宽
  
        // strokeStyle: "solid"  //线样式
    });

  // 将 icon 传入 marker
  var  line_s1_startMarker = new AMap.Marker({
      position: new AMap.LngLat(line_s1_start[0],line_s1_start[1]),
      icon: startIcon,
      offset: new AMap.Pixel(-13, -30)
  });

  

  // 将 icon 传入 marker
  var  line_s1_endMarker = new AMap.Marker({
      position: new AMap.LngLat(line_s1_end[0],line_s1_end[1]),
      icon: endIcon,
      offset: new AMap.Pixel(-13, -30)
  });

// 将 markers 添加到地图
 map.add([    line_s1_startMarker,  line_s1_endMarker]);
 

</script>
</body>
</html>